import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

import authorityRouter from '@/pages/authority/router';
// import datasRouter from '@/pages/datas/router';
import scaleRouter from '@/pages/scale/router';
import individualRouter from '@/pages/individual/router';
import psychologyRouter from '@/pages/psychology/router';
import hospitalRouter from '@/pages/hospital/router';
import mallRouter from '@/pages/mall/router';
import pcRouter from '@/pages/pc/router';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'indexLayout',
    redirect: { name: 'index' },
    component: () => import('@/layouts/LayoutFloorThree.vue'), // 懒加载组件
    children: [
      {
        path: '/',
        name: 'index',
        component: () => import('@/pages/home/Index.vue'),
      },
    ],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/pages/login/index.vue'), // 懒加载组件
  },

  ...authorityRouter,
  ...scaleRouter,
  ...individualRouter,
  ...psychologyRouter,
  ...hospitalRouter,
  ...mallRouter,
  ...pcRouter,
  // ...datasRouter,
];

// {
//   path: '/tools',
//   name: 'tools',
//   redirect: { name: 'toolsColors' },
//   component: () => import('@/layouts/LayoutFloorThree.vue'), // 懒加载组件
//   children: [
//     {
//       path: '/tools/colors',
//       name: 'toolsColors',
//       component: () => import('@/pages/tools/Color.vue'),
//     },
//     {
//       path: '/tools/web',
//       name: 'toolsWeb',
//       component: () => import('@/pages/tools/Web.vue'),
//     },
//     {
//       path: '/tools/canlendar',
//       name: 'toolsCanlendar',
//       component: () => import('@/pages/tools/Canlendar.vue'),
//     },
//   ],
// },

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
